<template>
  <div id="app">
    <basicLayoust />
  </div>
</template>
<style>
#app {
}
</style>
<script setup lang="ts">
import BasicLayoust from "@/Layouts/basicLayoust.vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";

const router = useRouter();
const store = useStore();
router.beforeEach((to, from, next) => {
  if (to.meta.access === "canAdmin") {
    if (store.state.user.loginUser.role !== "admin") {
      next("/NoPermission");
      return;
    }
  }
  next();
});
</script>
